package org.djw.hrm.feign.client;

import org.djw.hrm.domain.Login;
import org.djw.hrm.domain.MealAndLogin;
import org.djw.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 认证中心客户端调用接口
 */
@FeignClient(value = "auth-server",fallbackFactory = AuthFeignClientFallbackFactory.class)
public interface AuthFeignClient {

    @RequestMapping(value = "/login/{username}",method = RequestMethod.POST)
    Login getByUsername(@PathVariable("username") String username);

    @RequestMapping(value="/login/save",method= RequestMethod.POST)
    AjaxResult save(@RequestBody Login login);

    @RequestMapping(value="/login/add",method= RequestMethod.POST)
    void saveMealAndLogin(@RequestBody MealAndLogin mealAndLogin);
}
